﻿@model List<TJBHJJ.Models.News>
@{
    ViewBag.Title = "新闻列表";
    int pagecount = (int)ViewData["pageCount"];
    int pageindex = (int)ViewData["pageIndex"];
}
<script type="text/javascript">
    $(function () {
        $("#tabs").tabs();
    });

//    var editor;

//    var options = {
//        allowFileManager: true,
//        uploadJson: '/Manager/UploadImage'
//    };

//    function KEcreate() {
//        $.getScript('../../Scripts/kindeditor/kindeditor-min.js', function () {
//            KindEditor.basePath = '../../Scripts/kindeditor/';
//            editor = KindEditor.create('textarea[name="Content"]', options);
//        });

//        //        $('.validation-summary-errors').html('');
//        //        $('.input-validation-error').removeClass('input-validation-error');
//        //        $('.field-validation-error').remove();

//    }

</script>
<div id="tabs">
    <ul>
        <li><a href="#tabs-1">新闻列表</a></li>
    </ul>
    <div id="tabs-1">
        <table>
            <tr style="background-color: #e8eef4">
                <td style="width: 400px">
                    标题
                </td>
                <td style="width: 200px">
                    添加时间
                </td>
                <td style="width: 50px">
                    修改
                </td>
                <td style="width: 50px">
                    删除
                </td>
            </tr>
            @foreach (var v in Model)
            {
                if (v.Title != null)
                {
                <tr>
                    <td>
                        @(v.Title.Length > 30 ? v.Title.Substring(0, 30) + "..." : v.Title)
                    </td>
                    <td>@v.CreatTime
                    </td>
                    <td>@Html.ActionLink("修改", "NewEdit", new { page = pageindex, id = v.Id })
                    </td>
                    <td>@Html.ActionLink("删除", "NewDelete", new { page = pageindex, id = v.Id }, new { onclick = "return confirm('确认删除吗？')" })
                    </td>
                </tr>
                }
            }
            <tr>
                <td colspan="4" align="center">
                    @Html.ActionLink("[首页]", "NewList", new { page = 0 })
                    @for (int i = 1; i < pagecount; i++)
                    {
                        if (i == pageindex)
                        {
                        <strong style="color: Red;">@Html.ActionLink("[" + i + "]", "NewList", new { page = i })</strong>
                        }
                        else
                        {
                        @Html.ActionLink("[" + i + "]", "NewList", new { page = i })
                        }
                    }
                    @Html.ActionLink("[末页]", "NewList", new { page = pagecount })
                </td>
            </tr>
            <tr>
                <td colspan="4">
                    @Html.ActionLink("添加新闻", "News")
                </td>
            </tr>
        </table>
    </div>
</div>
